/**
 * http://usejsdoc.org/
 * 生成实体类
 */
let ejs = require('../../ejs/ejsUtil.js');
let path=require('path');
let fs=require('fs');
let mutil=require('../../ejs/EjsDataHandler.js');
let fileName=path.resolve(__dirname,"../../../template/entry.ejs");

exports.handler=function(data){
	if(selfConfig.test)return ;
	// log(data.tables["user"]);
	for(var index in data.tables){
		// log(data.tables[index])
		ejs.mrenderFile(fileName,{
			table:data.tables[index],
			obj:data
		},(err,str)=>{
			if(err)console.log(err);
			console.log(mutil.toPasic(index))
			fs.writeFileSync(path.resolve(__dirname,selfConfig['base_root'],mutil.toPasic(index)+".java"),str);
		});
	}

}


